home *** CD-ROM | disk | FTP | other *** search
/ Best of Shareware / Best of PC Windows Shareware 1.0 - Wayzata Technology (7111) (1993).iso / mac / WINDOWS / EDUCATON / UPT / UPT1.EXE / DB.TXT < prev    next >
Text File  |  1992-08-25  |  17KB  |  334 lines

  1.  
  2.                Pro Power Tips 1.0A (c) 1992  Scanlon Enterprises
  3.  
  4.         ────────────────────────────────────────────────────────────────
  5.  
  6.                               DATA BASE POWER TIPS
  7.  
  8.         ────────────────────────────────────────────────────────────────
  9.  
  10.  
  11.         When you use a data base system, no matter which one, you need 
  12.         to create records, make reports and present data, in a concise 
  13.         and timely manner. Pro Power Tips, Database section, will guide 
  14.         you in these and other Database matters.
  15.  
  16.  
  17.         Enhance Your dBase Logic Field Usage
  18.  
  19.         Tired of explaining what T and F stand for in DBase III Plus 
  20.         Reports? If your DBase reports often display the contents of 
  21.         logical fields, you'll produce more readable output by using 
  22.         DBase's IFF() function with the Active expression to substitute 
  23.         words for the logical values. Suppose you have a file called 
  24.         Vendors with a logical field called Active, containing T & F in 
  25.         a report column, instead of the Active Expression itself, use 
  26.         "IFF(ACTIVE,'YES','NO'". You can also use "IFF(ACTIVE, 
  27.         'Active','Inactive'".
  28.  
  29.  
  30.  
  31.         Add Printer Codes for Better-Looking dBase Output
  32.  
  33.         You can spruce up dBase III plus reports by using printer 
  34.         control codes to produce compressed type, underlining, boldface 
  35.         and other print styles. Just use the following commands. ".SET 
  36.         DEVICE TO PRINT"
  37.                   ".@ PROW(),PCOL() SAY CHR(15)"
  38.                   ".SET DEVICE TO SCREEN"
  39.         In the example above, "@ PROW(),PCOL() SAY" sends the control 
  40.         code "CHR(15)" (compressed type for Epson and IBM compatibles), 
  41.         to the printer at its current location. Substitute other control 
  42.         codes (which of course must be specific to your printer) to 
  43.         effect other print styles. The commands can be entered at the 
  44.         dot prompt, saved in their own command file or used within other 
  45.         command files.
  46.  
  47.  
  48.  
  49.         Paradox Shortcut, Pick Your Own Editor
  50.  
  51.         If you don't like the Paradox Script Editor, you can assign 
  52.         another ASCII text editor, such as Brief or Word, to run in 
  53.         Paradox. First be sure the text editors directory is referenced 
  54.         by the system PATH statement. From Paradox's main menu, select 
  55.         Script Play and type "CUSTOM" and press <ENTER>. Now answer the 
  56.         prompt about your monitor, and from a subsequent menu, choose 
  57.         Pal Editor. Type the name of the executable file that invokes 
  58.         your text editor, and follow it with a space and an asterisk. 
  59.         The asterisk, indicates that you want whatever script file is 
  60.         loaded when you invoke the editor. Also, you can put an 
  61.         exclamation point before the editors file name to give the 
  62.         editor more memory, and/or you can add another space and two 
  63.         more asterisks to end the line if your editor can accept a line 
  64.         number that jumps you to that position in the script. To exit, 
  65.         press <ENTER>, select Return Do-It, Do-It, save the CFG file to 
  66.         either the harddisk or Network. Paradox will close. The next 
  67.  
  68.         time you load Paradox, Script Play will summon your favorite 
  69.         editor.
  70.  
  71.  
  72.  
  73.         dBase & Foxbase do Multiline Reporting
  74.  
  75.         Still stuck with an old dBase III Plus or Foxbase report writer? 
  76.         It may seem impossible to build a multiline report, but it's 
  77.         NOT. Here's the trick. Placing a semicolon within the column 
  78.         contents will wrap the column to the next line. This lets you 
  79.         load a multiline group of expressions, such as a three line 
  80.         address block, into a single column. To do this, enter the 
  81.         column contents, such as the following, into a single column. 
  82.  
  83.         TRIM(FNAME) + " " + TRIM(LNAME) + ";" + ADDRESS + ";" + 
  84.         TRIM(CITY) + " " + STATE + " " + ZIP
  85.  
  86.         The above should be entered continuously. Set the column width 
  87.         no narrower that the widest possible combination of data 
  88.         appearing between the semicolons, otherwise, you'll get 
  89.         unintended word wrap effects. Unfortunately, there's no easy way 
  90.         to box and address. For that you'll have to upgrade.
  91.  
  92.  
  93.  
  94.         From a Table to a Form
  95.  
  96.         A Browse screen table view shows you many records at once, while 
  97.         an Edit screen form gives you a clearer view of one record. 
  98.         dBase III Plus, offers no way to toggle easily between these 
  99.         views, but you can create such a toggle by programming. Here's 
  100.         how to do it with the least amount of code :
  101.                 X = .F.
  102.                 DO WHILE .NOT. X
  103.                    BROWSE
  104.                    EDIT
  105.                    @21,37 SAY "Exit?" GET X
  106.                    READ
  107.                 ENDDO
  108.                 RETURN
  109.         This example assumes that your data file is already open. The 
  110.         program starts a loop, that brings up the Browse screen, 
  111.         (dBase's table view). Here, you can scroll through your data and 
  112.         even edit it. When you exit Browse, by pressing <ESC> or <Ctrl>W 
  113.         the Edit screen appears, showing the record that was highlighted 
  114.         when you exited Browse. When you exit Edit, with <ESC>, you'll 
  115.         be asked if you want to exit the program. If you respond with 
  116.         "Y" or "T", the program terminates. If you answer "N" or "F", 
  117.         the program resumes looping, and brings you back to the Browse 
  118.         screen.
  119.  
  120.  
  121.  
  122.         Making a Form Your Own
  123.  
  124.         When you view data in Paradox, <F7> acts as a hot key for going 
  125.         between the table and form views. By default, the form displayed 
  126.         with the hot key is a simple vertical listing of your table's 
  127.         fields. But Paradox lets you redesign this form to make it 
  128.         easier to read. For instance, you can place CITY, STATE & ZIP 
  129.         fields on a single line. To change the form display, select 
  130.         Forms Change from the MAIN menu. Enter the name of your table 
  131.         when prompted, and press <ENTER> to select the highlighted "F" 
  132.         from the list of forms that can be changed. (Other forms are 
  133.         listed by number. If the table has no other forms, only the "F" 
  134.  
  135.         will be displayed.) Enter a description for the form, or press 
  136.         <ENTER> to keep the default, STANDARD FORM. That boring Standard 
  137.         Form now appears. Pressing <F10> brings up a menu of options for 
  138.         changing the look and, for that matter, the functionality of the 
  139.         form. For instance, you can use the Area Move command to move a 
  140.         field to another part of the screen, or the Border Place command 
  141.         to draw a box. Explore the menus to see what else is available. 
  142.         Once you are satisfied with your new form, press <F2> to save 
  143.         your work and exit. The next time you press <F7> from a table 
  144.         view, the current record will pop up using your new and improved 
  145.         form.
  146.  
  147.  
  148.  
  149.         Copy a Calculated Field in Paradox
  150.  
  151.         When you're designing a report, with a number of similar, 
  152.         complex, calculated fields, it's handy to copy a formula from 
  153.         one field to another. Unfortunately, Paradox, has no commands 
  154.         for doing this. You can get around this shortcoming, by creating 
  155.         an instant Script macro when you first enter the formula. While 
  156.         designing a report, before creating the first calculated field, 
  157.         press <Alt><F3> to start keystroke recording to an Instant 
  158.         Script. Then press <F10> and select Field Place Calculated. Next 
  159.         type in your formula, and press <ENTER> <Alt><F3> to end 
  160.         recording. When you want to place a similar calculated field in 
  161.         another location, simply press <Alt><F4> to play the Instant 
  162.         Script. You will soon be prompted to place the field. Press 
  163.         <ESC> <Ctrl>F, edit the formula, press <ENTER>, and place the 
  164.         field as prompted.
  165.  
  166.  
  167.  
  168.         Multi-Config for Q&A
  169.  
  170.         Changes made at Q&A's Utilities Set Global Defaults screen are 
  171.         saved in a file called QA.CFG. If you want to have alternative, 
  172.         reusable configurations, save one configuration before creating 
  173.         another, and copy this file to another name, such as QA2.CFG. To 
  174.         use QA2.CFG, copy it back to QA.CFG. This copy back and forth 
  175.         can be automated via a batch file. Don't forget to save the 
  176.         original QA.CFG, by copying it to a temporary file, such as 
  177.         QA.TMP, before you copy the QA2.CFG to QA.CFG.
  178.  
  179.         EXAMPLE: COPY the current QA.CFG file to QA1.CFG, you have now 
  180.         cloned the current config information. Now, enter Q&A's 
  181.         Utilities Set Global Defaults Screen, and set up your second Q&A 
  182.         configuration. EXIT Q&A and copy the new QA.CFG to QA2.CFG. Now, 
  183.         make two batch files, one called QA1.BAT the other QA2.BAT. The 
  184.         first line in each batch file will copy the correct QA config 
  185.         file. For QA1.BAT, this should be "COPY QA1.CFG QA.CFG", and for 
  186.         QA2.BAT, this should be "COPY QA2.CFG QA.CFG".
  187.  
  188.  
  189.  
  190.  
  191.         Getting the Right Record With DBase III Plus
  192.  
  193.         Set Relation, which links two data bases by a common key, is one 
  194.         of the most powerful DBase III Plus commands. However, Set 
  195.         Relation has one undocumented quirk that can produce undesirable 
  196.         results. When DBase searches the child data base for the first 
  197.         key that matches the parent data base's key, the matching record 
  198.         may be a deleted one, even if Set Delete is on. To avoid this 
  199.         problem, ensure that the child data base contains no deleted 
  200.         records before you create the relation by issuing a Pack 
  201.  
  202.         command.
  203.  
  204.  
  205.  
  206.         Duplicating Paradox Entries
  207.  
  208.         When working with Paradox 3.0+, it is often necessary to 
  209.         duplicate the contents of a field from one record to the next. 
  210.         To do this, use the Paradox "Ditto" key, which copies the value 
  211.         from the same field of the previous record. The "Ditto" key is 
  212.         the combined keystroke <Ctrl>-D. This key combination is listed 
  213.         in the index of both the Paradox Introduction and the User's 
  214.         Guide manual.
  215.  
  216.  
  217.  
  218.         Effective Data Base Reports
  219.  
  220.         Effective data base reports turn data into information, but if 
  221.         your readers can't tell what they're looking at, the report is 
  222.         nothing but a dead tree! An informative title and clear column 
  223.         headings go a long way toward telling a reports story.
  224.  
  225.         Use two-part report headlines. For the title, carefully, choose 
  226.         descriptive words commonly employed in your business which never 
  227.         change. Next, build a modifiable heading, which identifies the 
  228.         data set on the particular report. This is especially important 
  229.         if you use the same report form (or layout) for more than one 
  230.         type of report. Suppose, you use the same layout to generate two 
  231.         reports on customers, but select the listings by different 
  232.         criteria. One report might show all of your customers, while the 
  233.         other might include only those who haven't bought anything this 
  234.         year. Using the same report form, not only saves you time, but 
  235.         if you use a layout consistently, your co-workers will know, for 
  236.         instance, that the last purchase date is always in the fifth 
  237.         column. But, if both reports have the same headline, you'll have 
  238.         some confused and angry co-workers. Everyone will be much 
  239.         happier if you name these reports something like "Customers" and 
  240.         "Inactive Customers". Most data managers let you supply report 
  241.         headings at run time.
  242.  
  243.         Sorted Details: The heading can do double duty, by telling your 
  244.         readers what order the records are in. Most people, assume that 
  245.         a report is sorted by, or printed in the order of, its left-hand 
  246.         column. It's therefore best to design a report form with the 
  247.         sorted column (be it NAME, ZIP or something else), on the left. 
  248.         This is NOT always possible, especially if you're using the same 
  249.         report form for a number of reports. The solution, specify the 
  250.         sort order in your heading, as in "Inactive Customers (No 
  251.         Purchase in 1991)".
  252.  
  253.         At the head of the Column: After the report heading, the column 
  254.         headings are the best clues to what's on the report. The easiest 
  255.         (but not necessarily the smartest) thing to do is simply accept 
  256.         default in many report writers and use the field names provided. 
  257.         If the fields have simple names, like, "Phone", that's no 
  258.         problem, but a column headed "DTPOST" will confuse the boss. 
  259.         Therefore, when the field name is a code or abbreviation, spell 
  260.         it out in the column heading. For instance, "Date Posted" is 
  261.         much easier to understand at a glance, that "DTPOST". If your 
  262.         description column heading is wider that its column, split it 
  263.         into two lines. You can do this with virtually all report 
  264.         writers. Once you've spelled out your column headings, format 
  265.         then for easy reading. Parallel justification is important. A 
  266.         left justified or centered heading will look confusing over a 
  267.         column of right justified numbers. AS a general rule, you should 
  268.  
  269.         left justify character column headings, center those above dates 
  270.         and long descriptions and right justify heading over numbers. 
  271.         Other column heading design tips: Use uppercase and lower case 
  272.         letters. They're easier to read than all uppercase or lower 
  273.         case. Put a line below each column heading, stretching the full 
  274.         width of the column. If you've put some thought into your report 
  275.         heading and column headings, the people who read your reports 
  276.         will be happier. In the long career run, this will make you a 
  277.         happy camper.
  278.  
  279.  
  280.  
  281.         Naming Reports As You Print Them
  282.  
  283.         How would you go about printing, from a data base of all your 
  284.         customers, a report of just those customers added since last 
  285.         July? Assuming your report form is called CUSTLIST.FRM and your 
  286.         date field is called "First_Sale", the obvious answer is to use 
  287.         the command "REPORT FORM CustList TO PRINT FOR First_Sale >= C 
  288.         TO D("07/01/90")". One extra step will give your report a title 
  289.         that accurately reflects the data in the new report. The dBase 
  290.         REPORT command, has a little used HEADINGS option, that lets you 
  291.         add a title at print time. If you change the command to "REPORT 
  292.         FORM CustList TO PRINT FOR First_Sale >= C TO D("07/01/90") 
  293.         HEADING "Customers Added Since July 1, 1990", the resulting 
  294.         report will be much clearer to your co-workers.
  295.  
  296.  
  297.  
  298.         Reporting From a Paradox Query
  299.  
  300.         Paradox offers no direct way to print a report of only some of 
  301.         the records in a table. If you need a list of customers added 
  302.         since last July, for instance, you can't use your Customer 
  303.         table's Report R to print it. You can create an Ask query, that 
  304.         lists only those customers, then use the Tools Copy Report 
  305.         command to copy your report form from the Customer to the Answer 
  306.         table. Printing Answer's report rather than the Customer's will 
  307.         give you the selection you want. Even then, the reports' title 
  308.         won't state which customers are listed, and Paradox 3.0+ has no 
  309.         way to change a report title when you print it. So, before 
  310.         printing, the report, you'll have to use the Report Change 
  311.         command to change the name manually. Do this after you've copied 
  312.         the report to the Answer table, and be sure to change the name 
  313.         of the copy, not the original. If you have Paradox 3.5 is 
  314.         easier. When creating or changing the report, put a calculated 
  315.         field in the title's place, using a variable name as the 
  316.         expression. From then on, changing the contents of the variable 
  317.         will change the title of the report. <Alt><F10>MiniScript is an 
  318.         easy way to do this.
  319.  
  320.  
  321.  
  322.         Section finished. Be sure to order your THREE BONUS DISKS which 
  323.         expand this software package with vital tools, updates and 
  324.         additional tutorial material for computer users! Send $24.95 to 
  325.         Scanlon Enterprises, Department TIP, 38354 17th St. E., 
  326.         Palmdale, CA 93550. Bonus disks shipped promptly! Modifications, 
  327.         custom program versions, Site and LAN licenses of this package 
  328.         for business or corporate use are possible, contact the author. 
  329.         This software is shareware - an honor system which means TRY 
  330.         BEFORE YOU BUY. Press escape key to return to menu. 
  331.  
  332.  
  333.  
  334.